package com.ojoin.trade.common_core.web.domain;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ojoin.trade.common.utils.json.selfDefineBankMaskSerializer;
import com.ojoin.trade.common.utils.json.selfDefineIDCardMaskSerializer;
import com.ojoin.trade.common.utils.json.selfDefineMobileMaskSerializer;


/**
 * 商户基本信息
 * @author huanggc
 *
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class MerchantUserInfo implements Serializable {
	 
	//登录账号
	private String loginNo;
	
	private String doctype;//三证，五证
	
	/**
	 * 认证状态 
	 * "0","初始化"，"1","审批中"，"2","审核通过"，"3","审核未通过"
	 */
	private String realStatus;
	
	private String realNameStatus;
	
	//余额开户状态 AC00=已开户 AC01=未开户
	private String accStatus;
	
	private String  accNameStatus;

	//新版对应旧版np
	private String npaccAccStatus;

	private String npaccNameStatus;
	/**
	 * 是否设置过初始密码
	 * true未设置初始支付密码
	 * false已设置初始支付密码
	 */
	private String payPasswdIsNuLL;
	
	//驳回原因
	private String memo;
	
	//基本户账号
	@JsonSerialize(using = selfDefineBankMaskSerializer.class)
	private String bankAccount;
	
	private String mhtNo;
	private String mchType;
	private String mchName;
	
	@JsonSerialize(using = selfDefineMobileMaskSerializer.class)
	private String mobile;
	private String name;
	
	@JsonSerialize(using = selfDefineIDCardMaskSerializer.class)
	private String certNo;
	private String licNo;
	private String taxNo;
	private String certDate;
	private String openNo;
	private String orgNo;
	
	@JsonSerialize(using = selfDefineMobileMaskSerializer.class)
	private String cardMobile;
	
	//对公账号
	@JsonSerialize(using = selfDefineBankMaskSerializer.class)
	private String cardNo;
	private String cardProvince;
	private String cardCity;
	
	private String displayBranchNo;
	public String getDisplayBranchNo() {
		return displayBranchNo;
	}
	public void setDisplayBranchNo(String displayBranchNo) {
		this.displayBranchNo = displayBranchNo;
	}
	private String branchNo;
	
	public String getPayPasswdIsNuLL() {
		return payPasswdIsNuLL;
	}
	public void setPayPasswdIsNuLL(String payPasswdIsNuLL) {
		this.payPasswdIsNuLL = payPasswdIsNuLL;
	}
	 
	public String getLoginNo() {
		return loginNo;
	}
	public void setLoginNo(String loginNo) {
		this.loginNo = loginNo;
	}
	public String getRealStatus() {
		return realStatus;
	}
	public void setRealStatus(String realStatus) {
		this.realStatus = realStatus;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	//个人
	//身份证反面
	private String cardBack;
	//身份证正面
	private String cardObverse;
	
	public String getCardBack() {
		return cardBack;
	}
	public void setCardBack(String cardBack) {
		this.cardBack = cardBack;
	}
	public String getCardObverse() {
		return cardObverse;
	}
	public void setCardObverse(String cardObverse) {
		this.cardObverse = cardObverse;
	}
	//企业
	//法人身份证
	private String frsfz;
	//营业执照
	private String yyzz;
	//税务登记证 
	private String swdjz;
	//组织机构代码证
	private String zzjgdm;
	//开户许可证
	private String khhzd;
	//开户回执单
	private String khxkz;
	
	
	public String getFrsfz() {
		return frsfz;
	}
	public void setFrsfz(String frsfz) {
		this.frsfz = frsfz;
	}
	public String getKhhzd() {
		return khhzd;
	}
	public void setKhhzd(String khhzd) {
		this.khhzd = khhzd;
	}
	public String getKhxkz() {
		return khxkz;
	}
	public void setKhxkz(String khxkz) {
		this.khxkz = khxkz;
	}
	public String getSwdjz() {
		return swdjz;
	}
	public void setSwdjz(String swdjz) {
		this.swdjz = swdjz;
	}
	public String getYyzz() {
		return yyzz;
	}
	public void setYyzz(String yyzz) {
		this.yyzz = yyzz;
	}
	public String getZzjgdm() {
		return zzjgdm;
	}
	public void setZzjgdm(String zzjgdm) {
		this.zzjgdm = zzjgdm;
	}
	
	public String getMhtNo() {
		return mhtNo;
	}
	public void setMhtNo(String mhtNo) {
		this.mhtNo = mhtNo;
	}
	public String getMchType() {
		return mchType;
	}
	public void setMchType(String mchType) {
		this.mchType = mchType;
	}
	public String getMchName() {
		return mchName;
	}
	public void setMchName(String mchName) {
		this.mchName = mchName;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCertNo() {
		return certNo;
	}
	public void setCertNo(String certNo) {
		this.certNo = certNo;
	}
	public String getLicNo() {
		return licNo;
	}
	public void setLicNo(String licNo) {
		this.licNo = licNo;
	}
	public String getTaxNo() {
		return taxNo;
	}
	public void setTaxNo(String taxNo) {
		this.taxNo = taxNo;
	}
	public String getCertDate() {
		return certDate;
	}
	public void setCertDate(String certDate) {
		this.certDate = certDate;
	}
	public String getOpenNo() {
		return openNo;
	}
	public void setOpenNo(String openNo) {
		this.openNo = openNo;
	}
	public String getOrgNo() {
		return orgNo;
	}
	public void setOrgNo(String orgNo) {
		this.orgNo = orgNo;
	}
	public String getCardMobile() {
		return cardMobile;
	}
	public void setCardMobile(String cardMobile) {
		this.cardMobile = cardMobile;
	}
	public String getCardNo() {
		return cardNo;
	}
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}
	public String getCardProvince() {
		return cardProvince;
	}
	public void setCardProvince(String cardProvince) {
		this.cardProvince = cardProvince;
	}
	public String getCardCity() {
		return cardCity;
	}
	public void setCardCity(String cardCity) {
		this.cardCity = cardCity;
	}
	public String getBranchNo() {
		return branchNo;
	}
	public void setBranchNo(String branchNo) {
		this.branchNo = branchNo;
	}
	
	public String getBankAccount() {
		return bankAccount;
	}
	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}
	
	public void setAccStatus(String accStatus) {
		this.accStatus = accStatus;
	}
	public String getRealNameStatus() {
		return realNameStatus;
	}

	public void setRealNameStatus(String realNameStatus) {
		this.realNameStatus = realNameStatus;
	}
	public void setAccNameStatus(String accNameStatus) {
		this.accNameStatus = accNameStatus;
	}


	public String getAccNameStatus() {
		if(StringUtils.isNotEmpty(npaccNameStatus)){
			return npaccNameStatus;
		}
		return accNameStatus;
	}

	public String getAccStatus() {
		if(StringUtils.isNotEmpty(npaccAccStatus)){
			return npaccAccStatus;
		}
		return accStatus;
	}

	public void setNpaccAccStatus(String npaccAccStatus) {
		this.npaccAccStatus = npaccAccStatus;
	}

	public void setNpaccNameStatus(String npaccNameStatus) {
		this.npaccNameStatus = npaccNameStatus;
	}
	/**
	 * 营业执照不为空，税务登记证==组织机构代码证
	 * @return
	 */
	public String getDoctype() {
		if(null==doctype){
			if(StringUtils.isNotEmpty(this.licNo)&&StringUtils.isNotEmpty(this.taxNo)&&this.taxNo.equals(this.licNo)){
				return "3";
			}else{
				return "5";
			}
		}
		return doctype;
	}
	public void setDoctype(String doctype) {
		this.doctype = doctype;
	}
	
	public void formateDate(){
		if(this.certDate!=null&&this.certDate.length()==8){
			String formateDate=this.certDate.substring(0,4)+"-"+this.certDate.substring(4,6)+"-"+this.certDate.substring(6,8);
			this.setCertDate(formateDate);
		}
	}
}
